package com.clayecloud.common.client.controller;

import com.clayecloud.common.annotation.NoAuthorization;
import com.clayecloud.common.client.services.ReportForRepairService;
import com.clayecloud.common.entity.ReportForRepair;
import com.clayecloud.common.utils.MessageUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author ClayeLink
 * @date 2022/4/6 14:24
 */
@RestController
@RequestMapping("/reportrepair")
@Api(tags = "报事报修")
public class ClientReportForRepairController {

    @Resource
    private ReportForRepairService reportForRepairService;

    @PostMapping("/insert")
    @ApiOperation("增加报事报修")
    public MessageUtil insert(@RequestBody ReportForRepair reportForRepair){
        reportForRepair.setRrState(0);
        return reportForRepairService.insert(reportForRepair);
    }

    @GetMapping("/getlist")
    @ApiOperation("查询用户的上报信息")
    public MessageUtil selectByUserID(Long userID){
        return reportForRepairService.selectByUserId(userID);
    }

}
